<template>
  <div class="cocupload" :class="clazz">
    <Upload :action="action"
            :data="params"
            :headers="headers"
            list-type="picture-card"
            :limit="max"
            :file-list="fileList"
            :disabled="disabled"
            accept="image/gif, image/jpeg, image/png, image/bmp, image/jpg"
            :on-preview="doPreview"
            :on-remove="doRemove"
            :on-success="doSuccess"
            :before-upload="doBeforeUpload"
            :on-error="doError"
            :on-progress="doProgress"
            :on-change="doChange"
            :before-remove="doBeforeRemove"
            :on-exceed="doExceed"
    >
      <a-icon type="plus" />
    </Upload>
    <ImageViewer v-if="showViewer" :url-list="imageUrls" :on-close="doCloseViewer">
    </ImageViewer>
  </div>
</template>
<script>
import UploadJS from './Upload.js'
import {Upload} from 'element-ui'
import ImageViewer from 'element-ui/packages/image/src/image-viewer'

export default {
  mixins: [UploadJS],
  components: {Upload, ImageViewer},
};
</script>